<div class="maintop">
	当前位置：添加广告
	<a href="javascript:;" action="<?=$basepath?>?<?=$this->page_url($page_current,$page_url)?>" class="mainFrame button">返回</a>
	<a href="javascript:;" action="<?=$basepath?>_add?<?=$this->page_url($page_current,$page_url)?>" class="mainFrame button">刷新</a>
</div>
<div class="main-search">
</div>
<div id="mainbody">
	<div class="main">
		<div class="info">
				<form name="add_save" action="<?=$basepath?>_add_save" method="POST" target="ajax" func="form_submit">
					<div style="display:none;" class="hiddencontentdiv"><textarea id="hiddencontent" name="hiddencontent"></textarea></div>
					<dl><dt>广告标题：</dt><dd><input type="text" name="title" class="wtxt" /></dd></dl>
					<dl><dt>广告分类：</dt><dd><select type="text" name="categoryid" id="categoryid">
						<option value="0" select="selected">请选择所属分类</option>
						<?php
							if($category){
								foreach($category as $k=>$v){
									echo '<option value="',$k,'">',$v,'</option>';
								}
							}
						?>
					</select></dd></dl>
					<dl><dt>广告图标：</dt><dd><input type="text" name="pic" id="pic" class="wtxt" value="#" /></dd><dd><input type="button" name="uploadbutton" id="uploadbutton" value="选择" /></dd></dl>
					<dl><dt>链接地址：</dt><dd><input type="text" name="url" class="wtxt" value="#" /></dd><dd class="t">不为“#”时，系统将直接链接到此址</dd></dl>
					<dl><dt>开始时间：</dt><dd><input type="text" name="actiontime" class="int" value="<?=date('Y-m-d H:i:s',time())?>" </dd>
                    <dt>结束时间：</dt><dd><input type="text" name="endtime" class="int" value="0" </dd><dd class="t">0 为无结束时间</dd></dl>
                    <dl><dt>广告排序：</dt><dd><input type="text" name="sort" class="mint" value="<?=$maxsort ?>" /></dd><dd class="t">按0,1,2,3的顺序排序</dd>
                        <dt>分组关键字：</dt><input type="text" name="groupname" value="" class="int" /></dl>
					<dl><dt>广告状态：</dt><dd><select name="state">
						<option value="0" selected>禁用</option>
						<option value="1">启用</option>
					</select></dd></dl>
					<dl><dt>&nbsp;</dt><dd>
							<input type="submit" value="确认" class="btnbig" />
							<a href="javascript:;" action="<?=$basepath?>?<?=$this->page_url($page_current,$page_url)?>" class="mainFrame btnbig">返回</a>
					</dd></dl>
				</form>
		</div>
	</div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        <?php
        if(!empty($this->existsKeyInArray('categoryid',$_GET,'N'))){
            echo '$("#categoryid option[value='.$this->existsKeyInArray('categoryid',$_GET,'N').']").attr("selected", "selected");';
        }
        ?>
    });
</script>
<? $this->display('editor',array('textareaid'=>'hiddencontent','uploadbutton'=>'uploadbutton','inputid'=>'pic','uploadbutton1'=>'uploadbutton1','inputid1'=>'bgpic')); ?>
